//MovieTech.h
#ifndef MovieTech_H
#define MovieTech_H

#include "list.h"
#include "synch.h"
#include <stdarg.h>

class MovieTech
{
	public:
		MovieTech(char* name);
		~MovieTech();
		void SendMessage(char* name, int argc, ...);
		void SendMessage(char* name, IterList* args);
		void Scheduler();
		void Start();
		
		MsgList* msgList;
		void* replyTo;
		Lock* msgLock;
		Thread* myThread;
		char* myName;
		Condition* sleepCon;
		
		int numTakersReplyNeeded;
		//Possible status for MovieTech: Idle,WaitingForLobby,WaitingForTakers,StartingMovie,MovieOver,
		char* status;
		
		void CheckWithLobby();
		void AskTakerAboutLine();
		void TakerIsGood();
		void PlayMovie();
		void EndMovie();
};


#endif
